package com.example.dishchickenimageloader;

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {
    String url1 = "https://p2.music.126.net/KFsv-VqmBsJiVI1ysYS6iQ==/109951164383127764.jpg";
    String url2 = "https://p2.music.126.net/6y-UleORITEDbvrOLV0Q8A==/5639395138885805.jpg";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ImageView imageView = findViewById(R.id.imageView);
        ImageView imageView2 = findViewById(R.id.imageView2);
        ImageView imageView3 = findViewById(R.id.imageView3);
        ImageView imageView4 = findViewById(R.id.imageView4);

        Button button  = findViewById(R.id.button);
        Button button2 = findViewById(R.id.button2);
        Button button3 = findViewById(R.id.button3);
        Button button4 = findViewById(R.id.button4);

        button. setOnClickListener(v -> ImageLoader.with(MainActivity.this).load(url1).into(imageView));
        button2.setOnClickListener(v -> ImageLoader.with(MainActivity.this).load(url1).into(imageView2));
        button3.setOnClickListener(v -> ImageLoader.with(MainActivity.this).load(url2).into(imageView3));
        button4.setOnClickListener(v -> ImageLoader.with(MainActivity.this).load(url1).into(imageView4));

    }
}